package com.cloud.rou.log;

import com.cloud.rou.common.executor.AbstractVoidExecutor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 */
@Aspect
@Slf4j
public class SaveLogAspect extends AbstractVoidExecutor {
    @Around("@annotation(saveLog)")
    public Object around(ProceedingJoinPoint point, SaveLog saveLog) throws Throwable {
        String strClassName = point.getTarget().getClass().getName();
        String strMethodName = point.getSignature().getName();
        log.debug("[类名]:{},[方法]:{}", strClassName, strMethodName);
        // 异步操作日志
        this.asyncExecute(strClassName, strMethodName);
        return point.proceed();
    }


    /**
     * @param request
     */
    @Override
    public void doExecuteVoid(Object... request) {


    }
}
